import Vue from 'vue'
import VueRouter from 'vue-router'

//解决路由重复点击报错问题
let originPush=VueRouter.prototype.push;
VueRouter.prototype.push=function(location,resolve,reject){
   if(resolve && reject){
      //如果成功 调用原来的push方法  
           originPush.call(this,location,resolve,reject); 
               }else{
           originPush.call(this,location,()=>{},()=>{}); }    
}
Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    component: () => import(/* webpackChunkName: "/" */ '../views/Home.vue'),
  },
  {
    path: '/',
    name: 'mine',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "my" */ '../views/Mine.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
